.class public Lorg/microemu/app/util/ResURLConnection;
.super Ljava/net/URLConnection;
.source "ResURLConnection.java"


# static fields
.field private static final PREFIX:Ljava/lang/String; = "res:"


# instance fields
.field private entries:Ljava/util/Hashtable;


# direct methods
.method protected constructor <init>(Ljava/net/URL;Ljava/util/Hashtable;)V
    .locals 0
    .parameter "url"
    .parameter "entries"

    .prologue
    .line 41
    invoke-direct {p0, p1}, Ljava/net/URLConnection;-><init>(Ljava/net/URL;)V

    .line 43
    iput-object p2, p0, Lorg/microemu/app/util/ResURLConnection;->entries:Ljava/util/Hashtable;

    .line 44
    return-void
.end method


# virtual methods
.method public connect()V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 47
    return-void
.end method

.method public getInputStream()Ljava/io/InputStream;
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    const-string v5, "res:"

    .line 50
    iget-object v4, p0, Lorg/microemu/app/util/ResURLConnection;->url:Ljava/net/URL;

    invoke-virtual {v4}, Ljava/net/URL;->toString()Ljava/lang/String;

    move-result-object v3

    .line 51
    .local v3, location:Ljava/lang/String;
    const-string v4, "res:"

    invoke-virtual {v3, v5}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v2

    .line 52
    .local v2, idx:I
    const/4 v4, -0x1

    if-ne v2, v4, :cond_0

    .line 53
    new-instance v4, Ljava/io/IOException;

    invoke-direct {v4}, Ljava/io/IOException;-><init>()V

    throw v4

    .line 55
    :cond_0
    const-string v4, "res:"

    invoke-virtual {v5}, Ljava/lang/String;->length()I

    move-result v4

    add-int/2addr v4, v2

    invoke-virtual {v3, v4}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v3

    .line 56
    iget-object v4, p0, Lorg/microemu/app/util/ResURLConnection;->entries:Ljava/util/Hashtable;

    invoke-virtual {v4, v3}, Ljava/util/Hashtable;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, [B

    move-object v0, p0

    check-cast v0, [B

    move-object v1, v0

    .line 57
    .local v1, data:[B
    if-nez v1, :cond_1

    .line 58
    new-instance v4, Ljava/io/IOException;

    invoke-direct {v4}, Ljava/io/IOException;-><init>()V

    throw v4

    .line 60
    :cond_1
    new-instance v4, Ljava/io/ByteArrayInputStream;

    invoke-direct {v4, v1}, Ljava/io/ByteArrayInputStream;-><init>([B)V

    return-object v4
.end method
